<template>
    <div id="header">
        <div class="wrapper">
            <form action="/">
              <van-search
                v-model="value"
                background="#4fc08d"
                placeholder="请输入搜索关键词"
                @search="onSearch"
              ></van-search>
            </form>
      </div>
    </div>
</template>
<script>
 import { Search } from 'vant';
 import { Toast } from 'vant';
    export default {
      data() {
        return {
          value: ''
        };
      },
      methods: {
        onSearch(val) {
          Toast(val);
        }
      }
    }

    
</script>
<style lang="less" scoped>
     .wrapper {
            position: fixed;
            left: 0;
            top: 0;
            z-index: 2;
            height: 3.125rem;
            line-height: 3.125rem;
            width: 100%;
            box-sizing: border-box;
            background: white;
            border-bottom: solid 1px #eeeeee;
            border-top: solid 1px #eeeeee;
        }

        .iconLocation {
            position: absolute;
            left: 0.3rem;
            top: 1.0625rem;
            width: 1.875rem;
            height: 1rem;
            vertical-align: middle;
        }

        .locationWrapper {
            float: left;
            height: 3.125rem;
            width: 40%;
            white-space: nowrap;
            opacity: 1;
        }

        .locationWrapper .address {
            padding-left: 1.7rem;
            display: inline-block;
            font-size: 0.8rem;
            overflow: hidden;
            white-space: nowrap;
            text-overflow: ellipsis;
            width: 80%;
            vertical-align: middle;
        }

        .locationWrapper .iconArrow {
            vertical-align: middle;
        }

        .locationWrapper.wheel {
            opacity: 0;
            -webkit-transition: opacity 1.2s;
            transition: opacity 1.2s;
        }

        .searchWrapper {
            position: absolute;
            top: 0.625rem;
            right: 2%;
            line-height: 3.125rem;
            text-align: right;
            width: 50%;
            vertical-align: middle;
        }

        .searchWrapper.wheel {
            width: 96%;
            -webkit-transition: width 1s ease .2s;
            transition: width 1s ease .2s;
        }

        .searchContent {
            float: right;
            border-radius: 3.125rem;
            width: 100%;
            height: 1.875rem;
            line-height: 1.875rem;
            text-align: center;
            background: #F2F2F2;
        }

        .iconSearchWrapper {
            display: inline-block;
            width: 1.25rem;
            height: 100%;
        }

        .iconSearch {
            margin-top: 0.3125rem;
            width: 1.25rem;
            height: 1.25rem;
        }

        .searchPrompt {
            display: inline-block;
            vertical-align: top;
            margin-left: 0.25rem;
            text-align: center;
            font-size: 0.875rem;
            color: #999999;
        }

        @media (min-width: 320px) {
            .searchWrapper {
                width: 55%;
            }
        }

        @media (min-width: 375px) {
            .searchWrapper {
                width: 57%;
            }
        }

        @media (min-width: 414px) {
            .searchWrapper {
                width: 62%;
            }
        }

        .icon {
            fill: #999;
            width: 1rem;
            height: 1rem;
        }
</style>